/* eslint-disable */
import React from 'react';
import { Table, Divider, Row, Col, Button } from 'antd';

import { emptyText, formatNoFixed, reservedDecimalPlace } from '../../../utils/commonUtil';

const RiskInformation = (props) => {

  const { riskInformationData, onCancel } = props;

  const AdministrativePunishmentRecord = [
    { title: '决定书文号', dataIndex: 'writtenDecision', key: 'writtenDecision', ellipsis: true, },
    { title: '违法行为类型', dataIndex: 'typeIllegal', key: 'typeIllegal', ellipsis: true, },
    { title: '行政处罚内容', dataIndex: 'contentPunishment', key: 'contentPunishment', ellipsis: true, },
    { title: '决定机关名称', dataIndex: 'decideName', key: 'decideName', ellipsis: true, },
    { title: '处罚决定日期', dataIndex: 'datePunishment', key: 'datePunishment', },
    { title: '公示日期', dataIndex: 'datePublic', key: 'datePublic', width: 100 },
  ];
  const AbnormalOperation = [
    {
      title: <div style={{ whiteSpace: "normal" }}> 列入经营异常名录原因</div >, dataIndex: 'includedAbnormalOperationReason', key: 'includedAbnormalOperationReason',
      ellipsis: true,
    },
    { title: '列入日期', dataIndex: 'inDate', key: 'inDate', width: 100 },
    { title: '列入机关名称', dataIndex: 'inDecideOrgan', key: 'inDecideOrgan', ellipsis: true, },
    {
      title: <div style={{ whiteSpace: "normal" }}> 移出经营异常名录原因</div >, dataIndex: 'abnormalOperationReason', key: 'abnormalOperationReason',
      ellipsis: true,
    },
    { title: '移出日期', dataIndex: 'outDate', key: 'outDate', width: 100 },
    { title: '移出机关名称', dataIndex: 'decideOrgan', key: 'decideOrgan', ellipsis: true, },
  ];
  const BlacklistInformation = [
    { title: '类型', dataIndex: 'type', key: 'type', },
    { title: <div style={{ whiteSpace: "normal" }}> 列入严重违法失信企业名单(黑名单)原因</div >, dataIndex: 'seriousReason', key: 'seriousReason', ellipsis: true, },
    { title: '列入日期', dataIndex: 'punishmentInDate', key: 'punishmentInDate', width: 100 },
    { title: '作出决定机关（列入）', dataIndex: 'includedPunishmentDecideOrgan', key: 'includedPunishmentDecideOrgan', },
    { title: <div style={{ whiteSpace: "normal" }}> 移出严重违法失信企业名单(黑名单)原因</div >, dataIndex: 'punishmentReason', key: 'punishmentReason', ellipsis: true, },
    { title: '移出日期', dataIndex: 'punishmentOutDate', key: 'punishmentOutDate', width: 100 },
    { title: '作出决定机关（移出）', dataIndex: 'punishmentDecideOrgan', key: 'punishmentDecideOrgan', },
  ];
  const PromiseEnterprise = [
    { title: '失信人类型', dataIndex: 'breakType', key: 'breakType', },
    { title: '被执行人姓名', dataIndex: 'subjectedPersonName', key: 'subjectedPersonName', },
    { title: '发布时间', dataIndex: 'releaseTime', key: 'releaseTime', },
    { title: '立案时间', dataIndex: 'caseTime', key: 'caseTime', },
    { title: '身份证号码/工商注册号', dataIndex: 'cardNumber', key: 'cardNumber', },
    { title: '执行法院', dataIndex: 'executionCourt', key: 'executionCourt', },
    { title: '执行依据文号', dataIndex: 'executionDocumentNumber', key: 'executionDocumentNumber', },
    { title: '案号', dataIndex: 'caseNumber', key: 'caseNumber', },
    { title: '失信被执行人行为具体情形', dataIndex: 'specificCircumstance', key: 'specificCircumstance', },
    { title: '被执行人履行情况', dataIndex: 'subjectedExecution', key: 'subjectedExecution', },
    { title: '已履行（元）', dataIndex: 'performed', key: 'performed', },
    { title: '未履行（元）', dataIndex: 'noPerformance', key: 'noPerformance', },
  ];
  const ChattelMortgageInformation = [
    { title: '登记编号', dataIndex: 'mortgageNo', key: 'mortgageNo', },
    { title: '登记日期', dataIndex: 'mortgageDate', key: 'mortgageDate', width: 100 },
    { title: '登记机关', dataIndex: 'mortgageOrg', key: 'mortgageOrg', },
    { title: '被担保债权数额', dataIndex: 'amountClaim', key: 'amountClaim', },
    { title: '状态', dataIndex: 'mortgageStatus', key: 'mortgageStatus', },
    { title: '公示日期', dataIndex: 'mortgageDatePublic', key: 'mortgageDatePublic', width: 100 },
  ];
  const EquityPledgeInformation = [
    { title: '登记编号', dataIndex: 'equityNo', key: 'equityNo', ellipsis: true, },
    { title: '出质人', dataIndex: 'pledge', key: 'pledge', },
    { title: <div style={{ whiteSpace: "normal" }}>证照/证件号码</div >, dataIndex: 'pledgeCertificateNo', key: 'pledgeCertificateNo', ellipsis: true, },
    {
      title: '出质股权数额', dataIndex: 'amountEquity', key: 'amountEquity',
      render: (text, record, index) => (
        <span>{formatNoFixed(reservedDecimalPlace(text, 2))}</span>
      ),
    },
    { title: '质权人', dataIndex: 'pledgedName', key: 'pledgedName', },
    { title: '证照/证件号码', dataIndex: 'pledgedCertificateNo', key: 'pledgedCertificateNo', },
    { title: '股权出质设立登记日期', dataIndex: 'equityDate', key: 'equityDate', },
    { title: '状态', dataIndex: 'equityStatus', key: 'equityStatus', },
    { title: '公示日期', dataIndex: 'equityPublicDate', key: 'equityPublicDate', width: 100 },
  ];
  const EquityFreezeInformation = [
    { title: '冻结金额（万元）', dataIndex: 'frozenAmount', key: 'frozenAmount', },
    { title: '冻结机关', dataIndex: 'frozenOrgan', key: 'frozenOrgan', },
    { title: '冻结起始日期', dataIndex: 'freezingStartDate', key: 'freezingStartDate', width: 100 },
    { title: '冻结文号', dataIndex: 'freezeTitanic', key: 'freezeTitanic', },
    { title: '解冻机关', dataIndex: 'thawAuthority', key: 'thawAuthority', },
    { title: '解冻文号', dataIndex: 'thawTitanic', key: 'thawTitanic', },
    { title: '解冻日期', dataIndex: 'releaseDate', key: 'releaseDate', width: 100 },
    { title: '解冻说明', dataIndex: 'defrostInstruction', key: 'defrostInstruction', },
    { title: '冻结截至日期', dataIndex: 'freezeEndDate', key: 'freezeEndDate', width: 100 },
  ];
  const EnvironmentalPenalties = [
    { title: '处罚日期', dataIndex: 'sortTime', key: 'sortTime', },
    { title: '决定书文号', dataIndex: 'decideNumber', key: 'decideNumber', },
    { title: '处罚事由', dataIndex: 'eventBasis', key: 'eventBasis', },
    { title: '处罚结果', dataIndex: 'eventResult', key: 'eventResult', },
    { title: '处罚单位', dataIndex: 'punishmentUnit', key: 'punishmentUnit', },
  ];
  const FaithlessAnnouncement = [
    { title: '案号', dataIndex: 'caseNo', key: 'caseNo', },
    { title: '内容', dataIndex: 'body', key: 'body', },
    { title: '义务', dataIndex: 'responsibility', key: 'responsibility', },
    { title: '法院名称', dataIndex: 'court', key: 'court', },
    { title: '立案时间', dataIndex: 'sortTime', key: 'sortTime', width: 100 },
    { title: '发布时间', dataIndex: 'postTime', key: 'postTime', width: 100 },
    { title: '依据文号', dataIndex: 'documentNumber', key: 'documentNumber', },
  ];

  return (
    <div>
      <Row>
        <Col span={24} align="right">
          <Button   onClick={() => onCancel()}>返回</Button>
        </Col>
      </Row>
      <Divider orientation="left">行政处罚记录</Divider>
      <Table
        size="small"
        columns={AdministrativePunishmentRecord}
        dataSource={riskInformationData.punishmentModelList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">经营异常</Divider>
      <Table
        size="small"
        columns={AbnormalOperation}
        dataSource={riskInformationData.abnormalOperationModelList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">列入严重违法企业名单信息</Divider>
      <Table
        size="small"
        columns={BlacklistInformation}
        dataSource={riskInformationData.blackListInformationList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">失信企业</Divider>
      <Table
        size="small"
        columns={PromiseEnterprise}
        dataSource={riskInformationData.promiseEnterpriseList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">动产抵押登记信息</Divider>
      <Table
        size="small"
        columns={ChattelMortgageInformation}
        dataSource={riskInformationData.mortgageModelList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">股权出质登记信息</Divider>
      <Table
        size="small"
        columns={EquityPledgeInformation}
        dataSource={riskInformationData.equityModelList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">股权冻结信息</Divider>
      <Table
        size="small"
        columns={EquityFreezeInformation}
        dataSource={riskInformationData.equityFreezeInformationList}
        pagination={false}
        scroll={{ y: 500 }}
        rowKey={record => record.id}
        style={{ marginBottom: "32px" }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">环保处罚</Divider>
      <Table
        size="small"
        columns={EnvironmentalPenalties}
        dataSource={riskInformationData.environmentPunishmentModelList}
        pagination={false}
        rowKey={record => record.id}
        scroll={{ y: 500 }}
        locale={{ emptyText }}
      />
      <Divider orientation="left">失信公告</Divider>
      <Table
        size="small"
        columns={FaithlessAnnouncement}
        dataSource={riskInformationData.faithLessList}
        pagination={false}
        rowKey={record => record.id}
        scroll={{ y: 500 }}
        locale={{ emptyText }}
      />
    </div>
  );
}

export default RiskInformation;
